﻿using Microsoft.Extensions.DependencyInjection;

using zijian666.Core.Abstractions;

namespace zijian666.DI.Abstractions;

/// <summary>
/// 自装配服务描述符构建器
/// </summary>
public interface IAutowiredFeature : IFeature, IOrdered
{
    /// <summary>
    /// 优先级, 默认0
    /// </summary>
    int Order => 0;
    /// <summary>
    /// 代理服务描述符
    /// </summary>
    ServiceDescriptor Proxy(ServiceDescriptor serviceDescriptor);

    /// <summary>
    /// 获取服务
    /// </summary>
    object? GetService(IAutowiredContext context, AutowiredDescriptor descriptor, Type serviceType);
}
